var mygroup_obj = {
		mygroup_find:function(){
			//滑动刷新
			var loadpage=1;
			mygroup_obj.loadhtml(loadpage);
			$(window).scroll(function(){
				 if ($(document).scrollTop() >= $(document).height() - $(window).height() && bool==true) {
//	                    alert("滚动条已经到达底部为" + $(document).scrollTop());
					 	loadpage++;
					 	mygroup_obj.loadhtml(loadpage);
	                }
			});
		},
		
		//加载成团信息
		loadhtml:function(loadpage){
			$(".loading_box").show();
			bool = false;
			$.post('?s=Vip/mygroup/p/'+loadpage,function(data){
				if(data.ret==1){
//					alert(data.msg[1]['createtime']);
					var html="";
					for(var i=0;i<data.msg.length;i++){
			            if(data.msg[i]['groupstatus'] == 7){
			            	continue;
			            }
			            html+='<div class="subtitle">开团时间：'+data.msg[i]['createtime']+'</div>'
				        html+='<dl class="clearfix">'
				        html+='<dt><img src="'+data.msg[i]['productcoverimg']+'"><i><img src="./Public/Wechat/api/images/caseicos.png"><ins>我是'
				        if(data.msg[i]['isleader'] == 1){
				             html+='团长'
				        }else{
				             html+='团员'
				        }
				        html+='</ins></i></dt>'
				        html+='<dd><p>'+data.msg[i]["productname"]+'</p></dd>'
				        html+='<dd>成团价：<i>￥'+data.msg[i]["productprice"]+'</i></dd>'
				        html+='<dd><span><a href="?s=/Vip/groupdetail/id/'+data.msg[i]["groupid"]+'">'+data.msg[i]["groupnumber"]+'人团</a><a href="?s=/Vip/groupdetail/id/'+data.msg[i]["groupid"]+'">'
				        var status = data.msg[i]["groupstatus"];
				        if(status == 1){
				            html+='正在进行'
				        }else if(status == 2){
				            html+='已成团'
				        }else if(status == 3){
				            html+='已发货'
				        }else if(status == 4){
				            html+='已完成'
				        }else if(status == 5){
				            html+='已取消'
				        }else if(status == 6){
				            html+='已过期'
				        }else{
				            html+='未付款'
				        }
				        html+='</a></span></dd>'
				        html+='</dl>'
					}
					$(".case").append(html);
					$(".loading_box").hide();
					bool = true;
				}else{
					if(loadpage==1){
						$(".case").append('<div class="morewords">暂无团!</div>');
						$(".loading_box").hide();
					}else{
//						$(".case").append('<div class="morewords">没有更多团!</div>');
						$(".loading_box").hide();
					}
				}
			});
		}
}